package Stack;

import java.util.Stack;

/**
 * User:浪尘
 * Date:2022-09-22
 * Time:18:36
 */
public class MyStack {
    public static void main(String[] args) {
        Stack<Integer> s1 = new Stack<>();
        s1.push(1);
        s1.push(2);
        s1.push(3);
        s1.push(4);
        s1.push(5);
        System.out.println(s1.empty());
//        System.out.println(s1.size());
//        System.out.println(s1.peek());
//        System.out.println(s1);
//        s1.pop();
//        s1.pop();
//        System.out.println(s1);
//        s1.pop();//将栈顶元素出栈并返回
//        System.out.println(s1.peek());//获取栈顶元素(元素并不出栈)
//        System.out.println(s1.size());//获取栈中元素的个数
//        boolean b1 = s1.empty();//判断栈是否为空
//        System.out.println(b1);
    }
}
